home *** CD-ROM | disk | FTP | other *** search
- // creates a tabbed control with number of other gadgets
-
- // include javascript classes
- include("oops/r3button.js");
- include("oops/r3tabbed.js");
- include("oops/r3cycle.js");
- include("oops/r3checkb.js");
- include("oops/r3slider.js");
- include("oops/r3window.js");
- include("oops/r3packer.js");
-
- var tabLabels = ["Buttons", "Sliders", "Check Boxes", "Cycles", 0];
- var subPackers = new Array(tabLabels.length);
- var window;
-
- // ---- create a window with a geometry manager ----
-
- toppacker = new r3Packer(R3PA_Orientation, R3PAOF_VERTICAL);
-
- window = new r3Window(R3WGA_Parent, _r3gui,
- R3WGA_Left, 200,
- R3WGA_Top, 100,
- R3WA_Title, "Window with Packer",
- R3WA_ReportCloseWindow, TRUE,
- R3WA_ReportNewSize, TRUE,
- R3WA_Gmanager, toppacker);
-
-
- // --- create a tab control with a geometry manager and callback ----
-
- function tabSelectHook(tab, event, activetab)
- {
- for(i = 0; i < tabLabels.length; i++) {
- if(i == activetab)
- subPackers[i].SetStealth(FALSE);
- else
- subPackers[i].SetStealth(TRUE);
- }
- tab.FIT(R3WFP_BESTFIT);
- }
-
- // packer
- packer = new r3Packer(R3PA_Orientation, R3PAOF_HORIZONTAL);
-
- // tabbed control
- tab = new r3Tabbed(R3WGA_Parent, window,
- R3TABA_Labels, tabLabels,
- R3RA_Hook, tabSelectHook,
- R3FRA_GManager, packer);
-
-
- // create a sub geometry manager for each tab.
-
- for(i = 0; i < tabLabels.length; i++) {
- subPackers[i] = new r3Packer(R3PA_Orientation, R3PAOF_VERTICAL);
- packer.ADD(R3PAPF_EXPAND | R3PAPF_FILLX | R3PAPF_FILLY, 0, subPackers[i]);
- }
-
-
- // create some controls for the each tab
- for(i = 0; i < 5; i++) {
- if(button = new r3Button(R3WGA_Parent, tab,
- R3GA_Text, "Button " + i))
- subPackers[0].ADD(R3PAPF_EXPAND | R3PAPF_FILLX | R3PAPF_FILLY, 0, button);
-
- if(slider = new r3Slider(R3WGA_Parent, tab,
- R3GA_Text, "Slider " + i))
- subPackers[1].ADD(R3PAPF_EXPAND | R3PAPF_FILLX, R3PAAF_ALIGN, slider);
-
- if(checkb = new r3Checkbox(R3WGA_Parent, tab,
- R3GA_Text, "Check Box " + i))
- subPackers[2].ADD(R3PAPF_EXPAND, R3PAAF_ALIGN, checkb);
-
- if(cycle = new r3Cycle(R3WGA_Parent, tab,
- R3GA_Text, "Cycle " + i,
- R3MXILTGA_Labels, ["Low", "Medium", "High"]))
- subPackers[3].ADD(R3PAPF_EXPAND | R3PAPF_FILLX, R3PAAF_ALIGN, cycle);
- }
-
- // insert tab into the window's gmanager
- toppacker.ADD(R3PAPF_EXPAND | R3PAPF_FILLX | R3PAPF_FILLY, 0, tab);
-
- // set default tab
- tabSelectHook(tab, 0, 0);
-
- window.FIT(R3WFP_BESTFIT);
- window.REALIZE();
-